/*
 * @Author: gao_m3
 * @Date: 2020-12-08 08:43:18
 * @LastEditors: wei_jt@ecidi.com
 * @LastEditTime: 2021-12-18 17:59:36
 * @Descripttion: 
 */
// import Cookies from 'js-cookie'
import * as types from './stateTypes'
import storage from '@/utils/storage'

const state = {
  [types.SIDE_BAR]: {
    // opened: Cookies.get( 'sidebarStatus' ) ? !!+Cookies.get( 'sidebarStatus' ) : true,
    opened: true,
    withoutAnimation: false
  },
  [types.DEVICE]: 'desktop',
  [types.SIDE_BAR_LOGO]: true,
  [types.AUTH_CONFIG]: {
    isGradeAuth: false,//授权类型 ，true为分级
    gradeAuthType: 0,//继承类型,true为单继承
  },
  [types.LATEST_CLIENT_CONFIG]: {},
  [types.INTERFACE_CONFIG]: {},
  [types.LOGIN_STRATEGY]: {},
  [types.ACCOUNT_CONFIG]: {},
  [types.WATERMARK_CONFIG]: {},
  [types.LANG]: {},
  [types.VISITED_VIEWS]: [],
  [types.CACHED_VIEWS]: [],
  [types.USER]: storage.get('user') ? JSON.parse(storage.get('user')) : {},
  [types.HAS_UNREAD_MESSAGE]: false,
  [types.RECEIVED_MESSAGE]: false,
  [types.ENUM]: {},
  [types.ROUTES]: [],
  [types.PERMISSION]: {},
  [types.PORTALS]: [],
  [types.PORTAL]: storage.get('portal') ? JSON.parse(storage.get('portal')) : {},
  [types.CLIENT_NAME]: '',
  [types.CURRENT_LANG]: storage.get('lang_config') || '',
  [types.WEBSOCKET_POOL]: [],
  [types.PERMISSION_QUEUE]: new Set()
}

export default state